<template>
	<view style="width: 750rpx;height: 98vh;">
		<view class="page-box" @click="intoOrderDetail(itemOrder)" v-for="itemOrder in billDetailList " :key="itemOrder.id" style="padding:0 20rpx;margin-top: 20rpx;">
			<view class="" style="width: 100%;background-color: #ffffff;border-radius: 20rpx;padding:20rpx;">
				<view class="" style="width: 100%;height: 20%;display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
					<view class="" style="display: flex;flex-direction: row;align-items: center;width: 80%;">
						<view class="" style="width: 2%;height: 40rpx;background-color: #2979FF;"></view>
						<view class="" style="margin-left: 2%;">订单编号：{{itemOrder.orderCode}}</view>
					</view>
				</view>
				<view class="" style="width: 100%;display: flex;flex-direction: column;justify-content: center;">
					<view class="" style="margin-top: 10rpx;">支付时间：{{itemOrder.payTime}}</view>
					<view class="" style="margin-top: 10rpx;">订单金额：<text style="color: red;font-size: 35rpx;">￥{{itemOrder.totalMoney}}</text></view>
				</view>
				<view class="" style="width: 100%;display: flex;flex-direction: row-reverse;margin-top: 20rpx;">
					<view class=""><u-button type="primary" @click="intoOrderDetail(itemOrder)" size="mini">查看详情</u-button></view>
				</view>
			</view>
		</view>
		<!-- <view class="" style="width: 100%;height: 100%;background-color: red;padding: 20rpx;">
			<view class="" v-for="item in billDetailList" :key="item.id" style="width: 100%;height: 200rpx;background-color: #ffffff;">
				
			</view>
			
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataForm:{
					shopBillId:'',
					
				},
				billDetailList:[]
			}
		},
		onLoad(e) {
			console.log(e);
			this.dataForm.shopBillId = e.id
			this.getDetail()
		},
		methods: {
			getDetail(){
				this.$u.get('life/shop/bill/order/page', this.dataForm).then(res => {
					console.log("我是账单详情");
					console.log(res)
					this.billDetailList = res.list
					console.log(this.billDetailList);
				}).catch(() => {
					this.$refs.uToast.show({
						title: "请求失败",
						type: 'error',
					})
				})
			},
			intoOrderDetail(e){
				let orderInfo = JSON.stringify(e)
				uni.setStorageSync('orderInfo',orderInfo)
				uni.navigateTo({
					url:'/pages/orderSonPage/orderDetail/orderDetail?orderCode=' + e.orderCode
				})
			},
		}
	}
</script>

<style>
	page{
		background-color:#F6F6F6;
	}
</style>
